Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/*: introduce go-dmflakey #628

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

fuweid
Copy link
Member

@fuweid fuweid commented Dec 5, 2023

This commit is to add go-binding for go-dmflakey. It's used to simulate powerfailure with common filesystems.

NOTE: If it's acceptable, I will mark my original repo https://github.com/fuweid/go-dmflakey as read-only and add comment that it has been moved to bbolt repo.

@fuweid
Copy link
Member Author

fuweid commented Dec 5, 2023

ping @ahrtr @serathius @jmhbnz

REF: #622 (comment)

.github/workflows/failpoint_test.yaml Show resolved Hide resolved
tests/dmflakey/loopback.go Show resolved Hide resolved
tests/dmflakey/dmsetup.go Outdated Show resolved Hide resolved
tests/dmflakey/dmflakey.go Show resolved Hide resolved
tests/dmflakey/dmflakey.go Outdated Show resolved Hide resolved
Comment on lines 26 to 27
defaultImgSize int64 = 1024 * 1024 * 1024 * 10 // 10 GiB
defaultInterval = 2 * time.Minute
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define the two items as constants.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Updated

// SyncFS attempts to synchronize filesystem before inject failure.
syncFS bool
// interval is used to determine how long the failure lasts.
interval time.Duration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To double check, in positive case (e.g. AllowWrites), the interval is the "up interval"; otherwise it's the "down interval"? If yes, please add a comment to make it clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Updated.

This commit is to add go-binding for go-dmflakey. It's used to simulate
powerfailure with common filesystems.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
@ahrtr ahrtr merged commit eeea655 into etcd-io:master Dec 7, 2023
13 checks passed
@fuweid fuweid deleted the init-godmflakey branch December 7, 2023 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants